
<!DOCTYPE html>
<html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-cn">
<head>
<title>购物车</title>

<!-- For-Mobile-Apps -->
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="E Shop Cart Widget Responsive, Login Form Web Template, Flat Pricing Tables, Flat Drop-Downs, Sign-Up Web Templates, Flat Web Templates, Login Sign-up Responsive Web Template, Smartphone Compatible Web Template, Android Compatible Web Template, Free Web Designs for Nokia, Samsung, LG, Sony Ericsson, Motorola Web Design" />
	<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //For-Mobile-Apps -->

<!-- Custom-Theme-Files -->
	<link rel="stylesheet" href="../css/style3.css" type="text/css" media="all" />
<!-- //Custom-Theme-Files -->

<!-- Remove-Item-JavaScript -->
	<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
	<script>
	
	
	
	function deletegood(myid){
	
	var data= {id:myid};
		$.ajax({
			 type:"POST",
             url:"/cartdel",
             data:data,
             async: false,
             dataType:'text',
             success:function(msg){
                 if(msg=='1'){
                 	   alert("删除成功");
					   $('.close'+myid).remove();
                       	$('.close'+myid).fadeOut('slow', function(c){
			});
                 }else{
                     alert("删除失败");
                 }
             },
             error:function(msg){
		     alert('失败');
		     }
		   
             
             
         });
	
	
	

}
	</script>
<!-- //Remove-Item-JavaScript -->

</head>

<!-- Body-Starts-Here -->
<body>

	<h1>E SHOP CART WIDGET</h1>

	<!-- Content-Starts-Here -->
	<div class="container">

		<!-- Mainbar-Starts-Here -->
		<div class="main-bar">
			<div class="product">
				<h3>Product</h3>
			</div>
			<div class="quantity">
				<h3>Quantity</h3>
			</div>
			<div class="price">
				<h3>Price</h3>
			</div>
			<div class="clear"></div>
		</div>
		<!-- //Mainbar-Ends-Here -->

		<!-- Items-Starts-Here -->
		<div class="items">

			<!-- Item1-Starts-Here -->
			<div th:each="good:${goods}" class="item1">
				<div th:class="close+${good.good_id}">
					<!-- Remove-Item --><div class="alert-close1"  th:id=${good.good_id} th:onclick="'javascript:deletegood('+${good.good_id}+')' "> </div><!-- //Remove-Item -->
					<div class="image1">
						<img height="60" width="60" th:src=@{${good.good_img}} alt="item1">
					</div>
					<div class="title1">
						<p th:text=${good.good_name}></p>
					</div>
					<div class="quantity1">
						<form action="action_page.php">
							<input type="number" name="quantity" min="1" max="10" th:value=${good.number}>
						</form>
					</div>
					<div class="price1">
						<p th:text=${good.good_price}></p>
					</div>
					<div class="clear"></div>
				</div>
			</div>
			<!-- //Item1-Ends-Here -->

			<!-- Item2-Starts-Here -->
			
		<!-- //Items-Ends-Here -->

		<!-- Total-Price-Starts-Here -->
		<div class="total">
			<div class="total1">Total Price</div>
			<div class="total2" th:text=${total}></div>
			<div class="clear"></div>
		</div>
		<!-- //Total-Price-Ends-Here -->

		<!-- Checkout-Starts-Here -->
		<div class="checkout">
			<div class="discount">
				<span>Apply Discount Code</span> <input type="text">
			</div>
			<div class="add">
				<a href="#">Add to Cart</a>
			</div>
			<div class="checkout-btn">
				<a href="/paycheck">Checkout</a>
			</div>
			<div class="clear"></div>
		</div>
		<!-- //Checkout-Ends-Here -->

	</div>
	<!-- Content-Ends-Here -->

	<!-- Copyright-Starts-Here -->
	<div class="copyright">
	    <p>&copy; 2016 E Shop Cart. All Rights Reserved | Template by <a href="http://w3layouts.com/"> W3layouts </a></p>
	</div>
	<!-- //Copyright-Ends-Here -->

</body>
<!-- Body-Ends-Here -->

</html>